package edu.dayu.decorator;

public class Test {
    public static void main(String[] args) {
        Shape circle = new Circle();
        circle.draw();
        // 圆
        System.out.println();
        circle = new RedShapeDecorator(circle);
        circle.draw();
        // 圆--已装饰成红色
        circle = new GreenShapeDecorator(circle);
        circle.draw();
        // 圆--已装饰成红色 --已装饰成绿色
        ShapeDecorator redRectangle = new RedShapeDecorator(new Rectangle());
        redRectangle.draw();
        // 三角形--已装饰成红色
    }
}
